
import { _decorator, Component, Button } from 'cc';
import * as cc from 'cc';
const { ccclass, property } = _decorator;

import DialogMgr from "../../lib/dialog/DialogMgr";
import AlertMgr from "../../moudle/alert/AlertMgr";
import LoaderMgr from "../../lib/loader/LoaderMgr";
import AudioMgr from "../../lib/audio/AudioMgr";
import EventMgr from "../../lib/event/EventMgr";
import HallMgr from './HallMgr';
import { EventConfig } from '../../lib/event/EventConfig';
import SceneBase from '../../lib/scene/SceneBase';
/**
* 大厅 场景
*/
@ccclass('HallScene')
export default class HallScene extends SceneBase {
    onLoad() {
        HallMgr.setTarget(this);

        // cc.director.preloadScene('Game');
        this.onShow();
    }

    /**
     * 事件响应
     * @param event_name 
     * @param param 
     */
    public responseEvent(event_name: keyof typeof EventConfig, param: any) {
        switch (event_name) {
            case "OnShow":// 监听后台切前台事件 EventConfig.OnShow
                this.onShow();
                break;
        }
    }

    private onShow() {
        AudioMgr.play("HallBgm", true, undefined, true);
    }
}
